package com.example.test_app

import android.os.Bundle
import android.view.KeyEvent
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.NavController
import androidx.navigation.fragment.findNavController


class TestNavFragment : Fragment() {
    private val mNavController by lazy { findNavController() }
    private var rootView: View? = null
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        rootView = inflater.inflate(R.layout.fragment_test_nav, container, false)
        initView(rootView!!)
        return rootView
    }

    private fun initView(view: View) {
        rootView?.findViewById<View>(R.id.tv_1)?.setOnClickListener {
            mNavController.navigate(TestNavFragmentDirections.action2Blank2())
        }
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
    }


}